package com.example.demo.controller;


import com.example.demo.dto.LoginDto;
import com.example.demo.model.Result;
import com.example.demo.service.SysUserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@AllArgsConstructor
public class LoginController {

    private SysUserService sysUserService;

    @PostMapping
    public Result login(@RequestBody LoginDto loginDto) {
        return sysUserService.login(loginDto);
    }
}
